/**
 * Created by ch-hui on 15/12/20.
 */
$(function(){

    /**
     * 以下为编辑或新增页面脚本
     */
    var supplyId = $("input[name=supplyId]").val();
    if(supplyId){
        $("h5").find("small").html("编辑");
        $("#deleteButton").show();
    }else{
        $("h5").find("small").html("新增");
        $("#deleteButton").hide();
    }

    $("#backButton").bind("click",function(){
        location.href = BASE + "/supply";
    });


    $("#signupForm").validate({
        rules: {
            supply_name: "required",
            contact_person: "required",
            telephone:"required"
        },
        messages: {
            supply_name: "请输入供应商名称",
            contact_person: "请输入联系人",
            telephone: "请输入联系人电话"
        }
    });
});